<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      const info = {
        firstName: "chen",
        lastName: "jack",
        // fullName: "jack chen",
        get fullName() {
          // 每次调用从新计算(动态)
          return `${this.lastName} ${this.firstName}`;
        },
      };
      console.log(info.fullName); //jack chen
      info.firstName = "wang";
      console.log(info.fullName); //jack wang
    </script>
  </body>
</html>
